<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<table class="list_table" width="100%">
<tr>
	<th>店铺</th>
	<th>Key</th>
	<th>Secret</th>
	<th>Access Token</th>
	<th>Refresh Token</th>
	<th>Refresh Token过期时间</th>
	<th>操作</th>
</tr>
<?php foreach ($shop as $s):?>
<tr>
	<td><?=$s['name']?></td>
	<td><?=$s['key']?></td>
	<td><?=$s['secret']?></td>
	<td><?=$s['access_token']?></td>
	<td><?=$s['refresh_token']?></td>
	<td><?=$s['refresh_token_expire_time']?></td>
	<td>
		<?if ($s['access_token'] && $s['refresh_token_expire_time'] > CURRENT_DATETIME):?>
		授权
		<?else:?>
		<a href="<?=$s['auth_url']?>">授权</a>
		<?endif;?>
	</td>
</tr>
<?php endforeach;?>
</table>
<?php $this->_endblock();?>